Overview | Package | Class | Tree | Deprecated | Index | Help Java Platform
1.1.7
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class com.sun.java.swing.JInternalFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--com.sun.java.swing.JComponent
                    |
                    +--com.sun.java.swing.JInternalFrame

public class JInternalFrame
extends JComponent
implements Accessible, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, WindowConstants, RootPaneContainer, java.awt.event.ComponentListener
A lightweight object that provides many of the features of a native frame, including dragging, closing, becoming an icon, resizing, title display, and support for a menu bar. Generally, you create an instance and add it to a JDesktopPane. Look and feel specific-actions are then (automatically??) delegated to the DesktopManager object maintained by the JDesktopPane (as set by the UI).

The JInternalFrame contentPane is where you add child components. So, to create a JInternalFrame that has a number of buttons arranged with a BorderLayout object, you might do something like this:

    JComponent c = frame.getContentPane();
    c.setLayoutManager(new BorderLayout());
    c.add(new JButton(), BorderLayout.NORTH);
    c.add(new JButton(), BorderLayout.CENTER);
 
The contentPane is actually managed by an instance of JRootPane, which also manages a layoutPane, glassPane, and optional menuBar for the frame. Please see the JRootPane documentation for a complete description of these components.

For the keyboard keys used by this component in the standard Look and Feel (L&F) renditions, see the JInternalFrame key assignments.

Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.

See Also:
JDesktopPane, DesktopManager, JDesktopIcon, JRootPane, Serialized Form

Inner Class Summary
JInternalFrame.AccessibleJInternalFrame
          The class used to obtain the accessible role for this object.
static  JInternalFrame.JDesktopIcon
          This component represents an iconified version of a JInternalFrame.
 
Inner classes inherited from class com.sun.java.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
boolean closable
          The frame can be closed.
static java.lang.String CONTENT_PANE_PROPERTY
          Bound property name.
JInternalFrame.JDesktopIcon desktopIcon
          The icon that is displayed when the frame is iconized.
Icon frameIcon
          The icon shown in the top-left corner of the frame.
static java.lang.String GLASS_PANE_PROPERTY
          Bound property name.
boolean iconable
          The frame can "iconized" (shrunk down and displayed as an icon-image).
static java.lang.String IS_CLOSED_PROPERTY
          Constrained property name indicating that the frame is closed.
static java.lang.String IS_ICON_PROPERTY
          Constrained property name indicating that the frame is iconified.
static java.lang.String IS_MAXIMUM_PROPERTY
          Constrained property name indicating that the frame is maximized.
static java.lang.String IS_SELECTED_PROPERTY
          Constrained property name indicated that this frame has selected status.
boolean isClosed
          The frame has been closed.
boolean isIcon
          The frame has been iconized.
boolean isMaximum
          The frame has been expanded to its maximum size.
boolean isSelected
          The frame is currently selected.
static java.lang.String LAYERED_PANE_PROPERTY
          Bound property name.
boolean maximizable
          The frame can be expanded to the size of the desktop pane.
static java.lang.String MENU_BAR_PROPERTY
          Bound property name.
boolean resizable
          The frame's size can be changed.
static java.lang.String ROOT_PANE_PROPERTY
          Bound property name.
boolean rootPaneCheckingEnabled
          If true then calls to add and setLayout cause an exception to be thrown.
JRootPane rootPane
          The JRootPane instance that manages the contentPane and optional menuBar for this frame, as well as the glassPane.
static java.lang.String TITLE_PROPERTY
          Bound property name.
java.lang.String title
          The title displayed in the frame's title bar.
 
Fields inherited from class com.sun.java.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
JInternalFrame()
          Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with no title.
JInternalFrame(java.lang.String title)
          Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title.
JInternalFrame(java.lang.String title, boolean resizable)
          Creates a non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title and with resizability specified.
JInternalFrame(java.lang.String title, boolean resizable, boolean closable)
          Creates a non-maximizable, non-iconifiable JInternalFrame with the specified title and with resizability and closability specified.
JInternalFrame(java.lang.String title, boolean resizable, boolean closable, boolean maximizable)
          Creates a non-iconifiable JInternalFrame with the specified title and with resizability, closability, and maximizability specified.
JInternalFrame(java.lang.String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
          Creates a JInternalFrame with the specified title and with resizability, closability, maximizability, and iconifiability specified.
 
Method Summary
void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
          By default, children may not be added directly to a this component, they must be added to its contentPane instead.
void addInternalFrameListener(InternalFrameListener l)
          Adds the specified internal frame listener to receive internal frame events from this internal frame.
void componentHidden(java.awt.event.ComponentEvent e)
           
void componentMoved(java.awt.event.ComponentEvent e)
           
void componentResized(java.awt.event.ComponentEvent e)
          Invoked when a maximized JInternalFrame's parent's size changes.
void componentShown(java.awt.event.ComponentEvent e)
           
JRootPane createRootPane()
          Called by the constructor to set up the JRootPane.
void dispose()
          Disposes of this internal frame.
AccessibleContext getAccessibleContext()
          Get the AccessibleContext associated with this JComponent
java.awt.Color getBackground()
          Get the background color of this object.
java.awt.Container getContentPane()
           
int getDefaultCloseOperation()
          Returns the default operation which occurs when the user initiates a "close" on this window.
JInternalFrame.JDesktopIcon getDesktopIcon()
          Returns the JDesktopIcon used when this JInternalFrame is iconified.
JDesktopPane getDesktopPane()
          Convenience method that searchs the anscestor heirarchy for a JDesktop instance.
java.awt.Color getForeground()
          Get the foreground color of this object.
Icon getFrameIcon()
          Returns the image displayed in the title bar of the frame (usually in the top-left corner).
java.awt.Component getGlassPane()
           
JLayeredPane getLayeredPane()
           
int getLayer()
          Convenience method for getting the layer attribute of this component.
JMenuBar getMenuBar()
          Returns the current JMenuBar for this JInternalFrame, or null if no menu bar has been set.
JRootPane getRootPane()
           
java.lang.String getTitle()
          Returns the title of the JInternalFrame.
java.lang.String getUIClassID()
          Returns the name of the L&F class that renders this component.
com.sun.java.swing.plaf.InternalFrameUI getUI()
          Returns the L&F object that renders this component.
java.lang.String getWarningString()
          Gets the warning string that is displayed with this window.
boolean isClosable()
          Returns whether this JInternalFrame be closed by some user action.
boolean isClosed()
          Returns whether this JInternalFrame is currently closed.
boolean isIconifiable()
          Returns whether the JInternalFrame can be iconified by some user action.
boolean isIcon()
          Returns whether the JInternalFrame is currently iconified.
boolean isMaximizable()
          Returns whether the JInternalFrame can be maximized by some user action.
boolean isMaximum()
          Returns whether the JInternalFrame is currently maximized.
boolean isResizable()
          Returns whether the JInternalFrame can be resized by some user action.
boolean isRootPaneCheckingEnabled()
          Returns whether calls to add and setLayout cause an exception to be thrown.
boolean isSelected()
          Returns whether the JInternalFrame is the currently "selected" or active frame.
void mouseClicked(java.awt.event.MouseEvent e)
          Ignore mouseClicked events.
void mouseDragged(java.awt.event.MouseEvent e)
          Ignore mouseDragged events.
void mouseEntered(java.awt.event.MouseEvent e)
          Forward the mouseEntered event to the underlying child container.
void mouseExited(java.awt.event.MouseEvent e)
          Forward the mouseExited event to the underlying child container.
void mouseMoved(java.awt.event.MouseEvent e)
          Forward the mouseMoved event to the underlying child container.
void mousePressed(java.awt.event.MouseEvent e)
          When inactive, mouse events are forwarded as appropriate either to the UI to activate the frame or to the underlying child component.
void mouseReleased(java.awt.event.MouseEvent e)
          Ignore mouseReleased events.
void moveToBack()
          Convenience method that moves this component to position -1 if it's parent is a JLayeredPane.
void moveToFront()
          Convenience method that moves this component to position 0 if it's parent is a JLayeredPane.
void pack()
          Causes subcomponents of this JInternalFrame to be laid out at their preferred size.
void processEvent(java.awt.AWTEvent e)
          Processes events on this internal frame.
void removeInternalFrameListener(InternalFrameListener l)
          Removes the specified internal frame listener so that it no longer receives internal frame events from this internal frame.
void reshape(int x, int y, int width, int height)
          Moves and resizes this component.
void setBackground(java.awt.Color c)
          Set the background color of this object.
void setClosable(boolean b)
          Set that this JInternalFrame can be closed by some user action.
void setClosed(boolean b)
          Calling this method with a value of true to close the frame.
void setContentPane(java.awt.Container c)
          Sets this JInternalFrame's content pane.
void setDefaultCloseOperation(int operation)
          Sets the operation which will happen by default when the user initiates a "close" on this window.
void setDesktopIcon(JInternalFrame.JDesktopIcon d)
          Sets the JDesktopIcon associated with this JInternalFrame.
void setForeground(java.awt.Color c)
          Set the foreground color of this object.
void setFrameIcon(Icon icon)
          Sets an image to be displayed in the titlebar of the frame (usually in the top-left corner).
void setGlassPane(java.awt.Component glass)
          Sets this JInternalFrame's glass pane.
void setIconifiable(boolean b)
          Set that the JInternalFrame can be made an icon by some user action.
void setIcon(boolean b)
          Iconizes and deconizes the frame.
void setLayeredPane(JLayeredPane layered)
          Sets this JInternalFrame's layered pane.
void setLayer(java.lang.Integer layer)
          Convenience method for setting the layer attribute of this component.
void setLayout(java.awt.LayoutManager manager)
          By default the layout of this component may not be set, the layout of its contentPane should be set instead.
void setMaximizable(boolean b)
          Set that the JInternalFrame can be maximized by some user action.
void setMaximum(boolean b)
          Maximizes and restores the frame.
void setMenuBar(JMenuBar m)
          Sets the JMenuBar for this JInternalFrame.
void setResizable(boolean b)
          Set that the JInternalFrame can be resized by some user action.
void setRootPaneCheckingEnabled(boolean enabled)
          Determines whether calls to add and setLayout cause an exception to be thrown.
void setRootPane(JRootPane root)
          Set the rootPane property.
void setSelected(boolean selected)
          Selects and deselects the JInternalFrame.
void setTitle(java.lang.String title)
          Sets the JInternalFrame title.
void setUI(com.sun.java.swing.plaf.InternalFrameUI ui)
          Sets the UI delegate for this JInternalFrame.
void setVisible(boolean b)
          Set the visible state of the object.
void show()
          Shows this internal frame, and brings it to the front.
void toBack()
          Sends this internal frame to the back.
void toFront()
          Brings this internal frame to the front.
void updateUI()
          Notification from the UIManager that the L&F has changed.
 
Methods inherited from class com.sun.java.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paint, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setBounds, setDebugGraphicsOptions, setDoubleBuffered, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

rootPane

protected JRootPane rootPane
The JRootPane instance that manages the contentPane and optional menuBar for this frame, as well as the glassPane.
See Also:
JRootPane, RootPaneContainer

rootPaneCheckingEnabled

protected boolean rootPaneCheckingEnabled
If true then calls to add and setLayout cause an exception to be thrown.

closable

protected boolean closable
The frame can be closed.

isClosed

protected boolean isClosed
The frame has been closed.

maximizable

protected boolean maximizable
The frame can be expanded to the size of the desktop pane.

isMaximum

protected boolean isMaximum
The frame has been expanded to its maximum size.
See Also:
maximizable

iconable

protected boolean iconable
The frame can "iconized" (shrunk down and displayed as an icon-image).
See Also:
JDesktopIcon

isIcon

protected boolean isIcon
The frame has been iconized.
See Also:
iconable

resizable

protected boolean resizable
The frame's size can be changed.

isSelected

protected boolean isSelected
The frame is currently selected.

frameIcon

protected Icon frameIcon
The icon shown in the top-left corner of the frame.

title

protected java.lang.String title
The title displayed in the frame's title bar.

desktopIcon

protected JInternalFrame.JDesktopIcon desktopIcon
The icon that is displayed when the frame is iconized.
See Also:
iconable

CONTENT_PANE_PROPERTY

public static final java.lang.String CONTENT_PANE_PROPERTY
Bound property name.

MENU_BAR_PROPERTY

public static final java.lang.String MENU_BAR_PROPERTY
Bound property name.

TITLE_PROPERTY

public static final java.lang.String TITLE_PROPERTY
Bound property name.

LAYERED_PANE_PROPERTY

public static final java.lang.String LAYERED_PANE_PROPERTY
Bound property name.

ROOT_PANE_PROPERTY

public static final java.lang.String ROOT_PANE_PROPERTY
Bound property name.

GLASS_PANE_PROPERTY

public static final java.lang.String GLASS_PANE_PROPERTY
Bound property name.

IS_SELECTED_PROPERTY

public static final java.lang.String IS_SELECTED_PROPERTY
Constrained property name indicated that this frame has selected status.

IS_CLOSED_PROPERTY

public static final java.lang.String IS_CLOSED_PROPERTY
Constrained property name indicating that the frame is closed.

IS_MAXIMUM_PROPERTY

public static final java.lang.String IS_MAXIMUM_PROPERTY
Constrained property name indicating that the frame is maximized.

IS_ICON_PROPERTY

public static final java.lang.String IS_ICON_PROPERTY
Constrained property name indicating that the frame is iconified.
Constructor Detail

JInternalFrame

public JInternalFrame()
Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with no title.

JInternalFrame

public JInternalFrame(java.lang.String title)
Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title.
Parameters:
title - the String to display in the title bar.

JInternalFrame

public JInternalFrame(java.lang.String title,
                      boolean resizable)
Creates a non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title and with resizability specified.
Parameters:
title - the String to display in the title bar.
resizable - if true, the frame can be resized

JInternalFrame

public JInternalFrame(java.lang.String title,
                      boolean resizable,
                      boolean closable)
Creates a non-maximizable, non-iconifiable JInternalFrame with the specified title and with resizability and closability specified.
Parameters:
title - the String to display in the title bar.
resizable - if true, the frame can be resized
closable - if true, the frame can be closed

JInternalFrame

public JInternalFrame(java.lang.String title,
                      boolean resizable,
                      boolean closable,
                      boolean maximizable)
Creates a non-iconifiable JInternalFrame with the specified title and with resizability, closability, and maximizability specified.
Parameters:
title - the String to display in the title bar.
resizable - if true, the frame can be resized
closable - if true, the frame can be closed
maximizable - if true, the frame can be maximized

JInternalFrame

public JInternalFrame(java.lang.String title,
                      boolean resizable,
                      boolean closable,
                      boolean maximizable,
                      boolean iconifiable)
Creates a JInternalFrame with the specified title and with resizability, closability, maximizability, and iconifiability specified.
Parameters:
title - the String to display in the title bar.
resizable - if true, the frame can be resized
closable - if true, the frame can be closed
maximizable - if true, the frame can be maximized
iconifiable - if true, the frame can be iconified
Method Detail

createRootPane

protected JRootPane createRootPane()
Called by the constructor to set up the JRootPane.
See Also:
JRootPane

getUI

public com.sun.java.swing.plaf.InternalFrameUI getUI()
Returns the L&F object that renders this component.
Returns:
the InternalFrameUI object that renders this component

setUI

public void setUI(com.sun.java.swing.plaf.InternalFrameUI ui)
Sets the UI delegate for this JInternalFrame.

updateUI

public void updateUI()
Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from the UIManager.
Overrides:
updateUI in class JComponent
See Also:
updateUI

getUIClassID

public java.lang.String getUIClassID()
Returns the name of the L&F class that renders this component.
Returns:
"InternalFrameUI"
Overrides:
getUIClassID in class JComponent
See Also:
getUIClassID, getUI

isRootPaneCheckingEnabled

protected boolean isRootPaneCheckingEnabled()
Returns whether calls to add and setLayout cause an exception to be thrown.
Returns:
true if add and setLayout are checked
See Also:
addImpl, setLayout, setRootPaneCheckingEnabled

setRootPaneCheckingEnabled

protected void setRootPaneCheckingEnabled(boolean enabled)
Determines whether calls to add and setLayout cause an exception to be thrown.
Parameters:
enabled - a boolean value, true if checking is to be enabled, which cause the exceptions to be thrown
See Also:
addImpl, setLayout, isRootPaneCheckingEnabled

addImpl

protected void addImpl(java.awt.Component comp,
                       java.lang.Object constraints,
                       int index)
By default, children may not be added directly to a this component, they must be added to its contentPane instead. For example:
 thisComponent.getContentPane().add(child)
 
An attempt to add to directly to this component will cause an runtime exception to be thrown. Subclasses can disable this behavior.
Throws:
java.lang.Error - if called with rootPaneChecking true
Overrides:
addImpl in class java.awt.Container
See Also:
setRootPaneCheckingEnabled

setLayout

public void setLayout(java.awt.LayoutManager manager)
By default the layout of this component may not be set, the layout of its contentPane should be set instead. For example:
 thiComponent.getContentPane().setLayout(new BorderLayout())
 
An attempt to set the layout of this component will cause an runtime exception to be thrown. Subclasses can disable this behavior.
Throws:
java.lang.Error - if called with rootPaneChecking true
Overrides:
setLayout in class java.awt.Container
See Also:
setRootPaneCheckingEnabled

getMenuBar

public JMenuBar getMenuBar()
Returns the current JMenuBar for this JInternalFrame, or null if no menu bar has been set.
Returns:
the JMenuBar used by this frame
See Also:
setMenuBar

setMenuBar

public void setMenuBar(JMenuBar m)
Sets the JMenuBar for this JInternalFrame.
Parameters:
m - the JMenuBar to use in this frame
See Also:
getMenuBar

getContentPane

public java.awt.Container getContentPane()
Description copied from interface:
Returns the contentPane.
Specified by:
getContentPane in interface RootPaneContainer

setContentPane

public void setContentPane(java.awt.Container c)
Sets this JInternalFrame's content pane.
Specified by:
setContentPane in interface RootPaneContainer
Parameters:
c - the Container to use for the contents of this JInternalFrame
Throws:
java.awt.IllegalComponentStateException - (a runtime exception) if the content pane parameter is null
See Also:
getContentPane

getLayeredPane

public JLayeredPane getLayeredPane()
Description copied from interface:
Returns the layeredPane.
Specified by:
getLayeredPane in interface RootPaneContainer

setLayeredPane

public void setLayeredPane(JLayeredPane layered)
Sets this JInternalFrame's layered pane.
Specified by:
setLayeredPane in interface RootPaneContainer
Throws:
java.awt.IllegalComponentStateException - (a runtime exception) if the layered pane parameter is null
See Also:
setLayeredPane

getGlassPane

public java.awt.Component getGlassPane()
Description copied from interface:
Returns the glassPane.
Specified by:
getGlassPane in interface RootPaneContainer

setGlassPane

public void setGlassPane(java.awt.Component glass)
Sets this JInternalFrame's glass pane.
Specified by:
setGlassPane in interface RootPaneContainer
See Also:
getGlassPane

getRootPane

public JRootPane getRootPane()
Description copied from interface:
Return this component's single JRootPane child. A conventional implementation of this interface will have all of the other methods indirect through this one. The rootPane has two children: the glassPane and the layeredPane.
Specified by:
getRootPane in interface RootPaneContainer
Overrides:
getRootPane in class JComponent

setRootPane

protected void setRootPane(JRootPane root)
Set the rootPane property. This method is called by the constructor.

setVisible

public void setVisible(boolean b)
Set the visible state of the object.
Parameters:
b - if true, shows this object; otherwise, hides it
Overrides:
setVisible in class JComponent

setClosable

public void setClosable(boolean b)
Set that this JInternalFrame can be closed by some user action.
Parameters:
b - a boolean value, where true means the frame can be closed

isClosable

public boolean isClosable()
Returns whether this JInternalFrame be closed by some user action.
Returns:
true if the frame can be closed

isClosed

public boolean isClosed()
Returns whether this JInternalFrame is currently closed.
Returns:
true if the frame is closed

setClosed

public void setClosed(boolean b)
              throws java.beans.PropertyVetoException
Calling this method with a value of true to close the frame.
Parameters:
b - a boolean, where true means "close the frame"
Throws:
java.beans.PropertyVetoException - when the attempt to set the property is vetoed by the receiver.

setResizable

public void setResizable(boolean b)
Set that the JInternalFrame can be resized by some user action.
Parameters:
b - a boolean, where true means the frame can be resized

isResizable

public boolean isResizable()
Returns whether the JInternalFrame can be resized by some user action.
Returns:
true if the frame can be resized

setIconifiable

public void setIconifiable(boolean b)
Set that the JInternalFrame can be made an icon by some user action.
Parameters:
b - a boolean, where true means the frame can be iconified

isIconifiable

public boolean isIconifiable()
Returns whether the JInternalFrame can be iconified by some user action.
Returns:
true if the frame can be iconified

isIcon

public boolean isIcon()
Returns whether the JInternalFrame is currently iconified.
Returns:
true if the frame is iconified

setIcon

public void setIcon(boolean b)
            throws java.beans.PropertyVetoException
Iconizes and deconizes the frame.
Parameters:
b - a boolean, where true means to iconify the frame and false means to deiconify it
Throws:
java.beans.PropertyVetoException - when the attempt to set the property is vetoed by the receiver.

setMaximizable

public void setMaximizable(boolean b)
Set that the JInternalFrame can be maximized by some user action.
Parameters:
b - a boolean where true means the frame can be maximized

isMaximizable

public boolean isMaximizable()
Returns whether the JInternalFrame can be maximized by some user action.
Returns:
true if the frame can be maximized

isMaximum

public boolean isMaximum()
Returns whether the JInternalFrame is currently maximized.
Returns:
true if the frame is maximized

setMaximum

public void setMaximum(boolean b)
               throws java.beans.PropertyVetoException
Maximizes and restores the frame. A maximized frame is resized to fully fit the JDesktopPane area associated with the JInternalFrame. A restored frame's size is set to the JInternalFrame's actual size.
Parameters:
b - a boolean, where true maximizes the frame and false restores it
Throws:
java.beans.PropertyVetoException - when the attempt to set the property is vetoed by the receiver.

getTitle

public java.lang.String getTitle()
Returns the title of the JInternalFrame.
Returns:
a String containing the frame's title
See Also:
setTitle

setTitle

public void setTitle(java.lang.String title)
Sets the JInternalFrame title.
Parameters:
title - the String to display in the title bar
See Also:
title

setSelected

public void setSelected(boolean selected)
                throws java.beans.PropertyVetoException
Selects and deselects the JInternalFrame. A JInternalFrame normally draws it's title bar differently if it is the selected frame, which indicates to the user that this internalFrame has the focus.
Parameters:
selected - a boolean, where true means the frame is selected (currently active) and false means it is not
Throws:
java.beans.PropertyVetoException - when the attempt to set the property is vetoed by the receiver.

isSelected

public boolean isSelected()
Returns whether the JInternalFrame is the currently "selected" or active frame.
Returns:
true if the frame is currently selected (active)
See Also:
setSelected

setFrameIcon

public void setFrameIcon(Icon icon)
Sets an image to be displayed in the titlebar of the frame (usually in the top-left corner). This image is not the desktopIcon object, which is the image displayed in the JDesktop when the frame is iconified.
Parameters:
icon - the Icon to display in the title bar
See Also:
desktopIcon

getFrameIcon

public Icon getFrameIcon()
Returns the image displayed in the title bar of the frame (usually in the top-left corner).
Returns:
the Icon displayed in the title bar

getBackground

public java.awt.Color getBackground()
Get the background color of this object.
Returns:
the background color, if supported, of the object; otherwise, null
Overrides:
getBackground in class java.awt.Component

setBackground

public void setBackground(java.awt.Color c)
Set the background color of this object. (For transparency, see isOpaque.)
Parameters:
c - the new Color for the background
Overrides:
setBackground in class java.awt.Component
See Also:
isOpaque

getForeground

public java.awt.Color getForeground()
Get the foreground color of this object.
Returns:
the foreground color, if supported, of the object; otherwise, null
Overrides:
getForeground in class java.awt.Component

setForeground

public void setForeground(java.awt.Color c)
Set the foreground color of this object.
Parameters:
c - the new Color for the foreground
Overrides:
setForeground in class java.awt.Component

moveToFront

public void moveToFront()
Convenience method that moves this component to position 0 if it's parent is a JLayeredPane.

moveToBack

public void moveToBack()
Convenience method that moves this component to position -1 if it's parent is a JLayeredPane.

setLayer

public void setLayer(java.lang.Integer layer)
Convenience method for setting the layer attribute of this component.
Parameters:
layer - an Integer object specifying this frame's desktop layer
See Also:
JLayeredPane

getLayer

public int getLayer()
Convenience method for getting the layer attribute of this component.
Returns:
an Integer object specifying this frame's desktop layer
See Also:
JLayeredPane

getDesktopPane

public JDesktopPane getDesktopPane()
Convenience method that searchs the anscestor heirarchy for a JDesktop instance. If JInternalFrame finds none, the desktopIcon tree is searched.
Returns:
the JDesktopPane this frame belongs to, or null if none is found

setDesktopIcon

public void setDesktopIcon(JInternalFrame.JDesktopIcon d)
Sets the JDesktopIcon associated with this JInternalFrame.
Parameters:
d - the JDesktopIcon to display on the desktop
See Also:
desktopIcon

getDesktopIcon

public JInternalFrame.JDesktopIcon getDesktopIcon()
Returns the JDesktopIcon used when this JInternalFrame is iconified.
Returns:
the JDesktopIcon displayed on the desktop
See Also:
desktopIcon

reshape

public void reshape(int x,
                    int y,
                    int width,
                    int height)
Moves and resizes this component. Unlike other components, this implementation also forces re-layout, so that frame decorations such as the title bar are always redisplayed.
Parameters:
x - an int giving the component's new horizontal position measured in pixels from the left of its container
y - an int giving the component's new vertical position, measured in pixels from the bottom of its container
width - an int giving the component's new width in pixels
height - an int giving the component's new height in pixels
Overrides:
reshape in class JComponent

addInternalFrameListener

public void addInternalFrameListener(InternalFrameListener l)
Adds the specified internal frame listener to receive internal frame events from this internal frame.
Parameters:
l - the internal frame listener

removeInternalFrameListener

public void removeInternalFrameListener(InternalFrameListener l)
Removes the specified internal frame listener so that it no longer receives internal frame events from this internal frame.
Parameters:
l - the internal frame listener

processEvent

protected void processEvent(java.awt.AWTEvent e)
Processes events on this internal frame. If the event has a InternalFrameEvent id, it notifies its internalFrameListener, else it invokes its superclass's processEvent.
Parameters:
e - the event
Overrides:
processEvent in class java.awt.Container

setDefaultCloseOperation

public void setDefaultCloseOperation(int operation)
Sets the operation which will happen by default when the user initiates a "close" on this window. The possible choices are:

The value is set to HIDE_ON_CLOSE by default.

See Also:
addInternalFrameListener, getDefaultCloseOperation

getDefaultCloseOperation

public int getDefaultCloseOperation()
Returns the default operation which occurs when the user initiates a "close" on this window.
See Also:
setDefaultCloseOperation

pack

public void pack()
Causes subcomponents of this JInternalFrame to be laid out at their preferred size.
See Also:
pack

show

public void show()
Shows this internal frame, and brings it to the front.

If this window is not yet visible, show makes it visible. If this window is already visible, then this method brings it to the front.

Overrides:
show in class java.awt.Component
See Also:
show, toFront, setVisible

dispose

public void dispose()
Disposes of this internal frame. If the frame is not already closed, a frame-closing event is posted.

toFront

public void toFront()
Brings this internal frame to the front. Places this internal frame at the top of the stacking order and makes the corresponding adjustment to other visible windows.
See Also:
toFront, moveToFront

toBack

public void toBack()
Sends this internal frame to the back. Places this internal frame at the bottom of the stacking order and makes the corresponding adjustment to other visible windows.
See Also:
toBack, moveToBack

getWarningString

public final java.lang.String getWarningString()
Gets the warning string that is displayed with this window. Since an internal frame is always secure (since it's fully contained within a window which might need a warning string) this method always returns null.
Returns:
null
See Also:
getWarningString

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
When inactive, mouse events are forwarded as appropriate either to the UI to activate the frame or to the underlying child component. In keeping with the MDI messaging model (which JInternalFrame emulates), only the mousePressed event is forwarded to the UI to activate the frame. The mouseEntered, mouseMoved, and MouseExited events are forwarded to the underlying child component, using methods derived from those in Container. The other mouse events are purposely ignored, since they have no meaning to either the frame or its children when the frame is inactive.
Specified by:
mousePressed(java.awt.event.MouseEvent) in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Forward the mouseEntered event to the underlying child container.
Specified by:
mouseEntered(java.awt.event.MouseEvent) in interface java.awt.event.MouseListener
See Also:
mousePressed

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Forward the mouseMoved event to the underlying child container.
Specified by:
mouseMoved(java.awt.event.MouseEvent) in interface java.awt.event.MouseMotionListener
See Also:
mousePressed

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Forward the mouseExited event to the underlying child container.
Specified by:
mouseExited(java.awt.event.MouseEvent) in interface java.awt.event.MouseListener
See Also:
mousePressed

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Ignore mouseClicked events.
Specified by:
mouseClicked(java.awt.event.MouseEvent) in interface java.awt.event.MouseListener
See Also:
mousePressed

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Ignore mouseReleased events.
Specified by:
mouseReleased(java.awt.event.MouseEvent) in interface java.awt.event.MouseListener
See Also:
mousePressed

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Ignore mouseDragged events.
Specified by:
mouseDragged(java.awt.event.MouseEvent) in interface java.awt.event.MouseMotionListener
See Also:
mousePressed

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Invoked when a maximized JInternalFrame's parent's size changes.
Specified by:
componentResized(java.awt.event.ComponentEvent) in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Description copied from interface:
 
Specified by:
componentMoved(java.awt.event.ComponentEvent) in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Description copied from interface:
 
Specified by:
componentShown(java.awt.event.ComponentEvent) in interface java.awt.event.ComponentListener

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Description copied from interface:
 
Specified by:
componentHidden(java.awt.event.ComponentEvent) in interface java.awt.event.ComponentListener

getAccessibleContext

public AccessibleContext getAccessibleContext()
Get the AccessibleContext associated with this JComponent
Specified by:
getAccessibleContext in interface Accessible
Returns:
the AccessibleContext of this JComponent
Overrides:
getAccessibleContext in class JComponent

Overview | Package | Class | Tree | Deprecated | Index | Help Java Platform
1.1.7
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Submit a bug or feature
Submit comments/suggestions about javadoc
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.